package org.xg.study.pd.test;

import com.alibaba.fastjson.JSONObject;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xg.study.pd.AuthController;
import org.xg.study.pd.AuthService;

import java.text.ParseException;
import java.util.Date;

/**
 * @author CMG
 * @version 1.0
 * @description
 * @cLassName ApiTest13_01
 * @date 2021/9/16 10:01
 **/
public class ApiTest13_01 {
    private Logger logger = LoggerFactory.getLogger(ApiTest13_01.class);

    @Test
    public void test_authController() throws ParseException {
        AuthController authController = new AuthController();
        //模拟三级负责人审批
        logger.info("测试结果：{}", JSONObject.toJSONString(authController.doAuth("xg", "100010322452", new Date())));
        logger.info("测试结果：{}", "模拟三级负责人审批，王工");
        AuthService.auth("10003", "100010322452");

        //模拟二级负责人审批
        logger.info("测试结果：{}", JSONObject.toJSONString(authController.doAuth("xg", "100010322452", new Date())));
        logger.info("测试结果：{}", "模拟二级负责人审批，王经理");
        AuthService.auth("1003", "100010322452");

        //模拟一级负责人审批
        logger.info("测试结果：{}", JSONObject.toJSONString(authController.doAuth("xg", "100010322452", new Date())));
        logger.info("测试结果：{}", "模拟一级负责人审批，王总");
        AuthService.auth("103", "100010322452");
    }
}
